﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Quartz.Net.Model;
using System.Data.OracleClient;
using System.Data;

namespace Quartz.Net.DAL
{
   public class Task_Quartz_OneJobRunLogDAL
    {
       public int InsertOneJobRun(Task_Quartz_OneJobRunLogModel model)
       {
           string strSql = @" insert into Task_Quartz_OneJobRunLog (NGUID,RUNGUID,JOBGUID,OPERATEDETAILS,OPERATETIME,OPERATEDATE,VALID)
                            values (:NGUID,:RUNGUID,:JOBGUID,:OPERATEDETAILS,:OPERATETIME,:OPERATEDATE,:VALID)";

           OracleParameter[] para = {
                                         new OracleParameter(":NGUID",OracleType.VarChar,200),
                                         new OracleParameter(":RUNGUID",OracleType.VarChar,200),
                                         new OracleParameter(":JOBGUID",OracleType.VarChar,200),
                                         new OracleParameter(":OPERATEDETAILS",OracleType.VarChar,2000),
                                         new OracleParameter(":OPERATETIME",OracleType.Timestamp,6),
                                         new OracleParameter(":OPERATEDATE",OracleType.DateTime),
                                         new OracleParameter(":VALID",OracleType.Char,1)
                                     };

           para[0].Value = model.NGUID;
           para[1].Value = model.RUNGUID;
           para[2].Value = model.JOBGUID;
           para[3].Value = model.OPERATEDETAILS;
           para[4].Value = model.OPERATETIME;
           para[5].Value = model.OPERATEDATE;
           para[6].Value = model.VALID;

           return DalBase.ExecuteNonQuery(strSql, para);

       }
    }
}
